<?
include('seguridad.php');
include('bd.php');
Conectar();
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
 <HEAD>
  <TITLE> BideYoday </TITLE>
  <META NAME="Generator" CONTENT="DILAPER">
  <META NAME="Author" CONTENT="Power by Sebastian Costa - Design: Nadia De Cinti">
  <META NAME="Keywords" CONTENT="">
  <META NAME="Description" CONTENT="">
  <link href="../style.css" rel="stylesheet" type="text/css">
  <script src="../js/botonera.js" type="text/javascript"></script>
  <script language="JavaScript" type="text/JavaScript">
function checkMail(x, filter)
{
	if (filter.test(x))	return true;
	return false;
}

function validar_coment(form)
{
	if(form.nombre.value == '') {
		alert("Ingresa tu nombre");
		form.nombre.focus();
		return false;
	}
	if(form.apellido.value == '') {
		alert("Ingresa tu apellido");
		form.apellido.focus();
		return false;
	}
	if(form.email.value == '') {
		alert("Ingresa tu mail");
		form.email.focus();
		return false;
	}
	ex_email = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if(!checkMail(form.email.value, ex_email)) {
		alert("Tu mail esta mal escrito");
		form.email.focus();
		return false;
	}
	if(form.clave.value == '') {
		alert("Ingresa tu clave");
		form.clave.focus();
		return false;
	}
	if(form.clave.value != form.veri_clave.value){
		alert("Verifique la clave nuevamente, hay un error");
		form.veri_clave.focus();
		return false;
	}
		
	document.getElementById('my_data').submit();
}
</script>
 </HEAD>

 <BODY topmargin="0">
<center>
<table width="990" height="100%" cellspacing="0" cellpadding="0" class="fondo" border="0">
	<tr>
		<td width="100%" height="100%" align="center" valign="top">
			<table width="100%" height="100%" cellspacing="0" cellpadding="0" border="0">
				<tr>
					<td align="center" valign="top">
<div style="height: 135px"></div>
<!-- contenido -->
<table width="800"  border="0" class="admin_area" cellspacing="0" cellpadding="0">
	<tr bgcolor="#ffffff">
		<td align="right" height="30">
Welcome <?echo $_SESSION['usuario'];?>&nbsp;|&nbsp;<a href="salir.php"><font color="red">Log Out</font></a>&nbsp;&nbsp;
		</td>
	</tr>	
	<tr><td height="3"></td></tr>
	<tr bgcolor="#ffffff">
		<td align="right" height="50">
<?include('menu.php');?>
		</td>
	</tr>	
	<tr><td height="3"></td></tr>
	<tr bgcolor="#ffffff">
		<td align="left" valign="top" height="300"  class="tabla_central">
<div style="margin: 10px">
<b><span class="titulo_admin">My Data</span></b><br>
<br>
On this screen you can change the information of the user.<br>
<br>
<?
$result=mysql_query("SELECT * FROM usuarios_admin WHERE id='".$_SESSION["id_usuario"]."'");
while($row = mysql_fetch_array($result, MYSQL_ASSOC)){
?>
<form id="my_data" method="POST" action="acciones/my_data_save.php">
	<table width="500" border="0" class="admin_area">
		<tr>
			<td align="right" width="250">
Name&nbsp;
			</td>
			<td>
<input type="text" name="nombre" value="<?echo$row[nombre];?>">
			</td>
		</tr>
		<tr>
			<td align="right">
Last Name&nbsp;
			</td>
			<td>
<input type="text" name="apellido" value="<?echo$row[apellido];?>">
			</td>
		</tr>
		<tr>
			<td align="right">
E-mail&nbsp;
			</td>
			<td>
<input type="text" name="email" value="<?echo$row[email];?>">
			</td>
		</tr>
		<tr>
			<td align="right">
Password&nbsp;
			</td>
			<td>
<input type="text" name="clave" value="<?echo$row[clave];?>">
			</td>
		</tr>
		<tr>
			<td align="right">
Verifies the<br>Password&nbsp;
			</td>
			<td>
<input type="text" name="veri_clave" value="<?echo$row[clave];?>">
			</td>
		</tr>
		<tr>
			<td></td>
			<td>
<input type="button" value="To modify" class="form_btn" onClick="javascript:validar_coment(document.getElementById('my_data'));">
			</td>
		</tr>
	</table>
</form>
<?}?>
</div>
<br>
		</td>
	</tr>
</table>
<table width="800" border="0" class="admin_area" cellspacing="0" cellpadding="0">
	<tr>
		<td height="3">

		</td>
	</tr>
	<tr bgcolor="#ffffff">
		<td align="right">
Area of administration of contendios of the web bidetoday.com &nbsp;&nbsp;&nbsp;
		</td>
	</tr>
</table>
<!-- fin contenido -->
					</td>
				</tr>
			</table>
		</td>
	</tr>
</table>
</center>
 </BODY>
</HTML>
<?Desconectar();?>